package com.uetoken.cn.adapter.holder;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.uetoken.cn.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class AbnormalViewHolder {
    @BindView(R.id.abnormalIv)
    public ImageView mAbnormalIv;
    @BindView(R.id.abnormalTv)
    public TextView mAbnormalTv;

    private OnRegainClickListener mOnRegainClickListener;

    public interface OnRegainClickListener {
        void onRegainData(View view);
    }

    public AbnormalViewHolder(View view) {
        ButterKnife.bind(this, view);
    }

    @OnClick({R.id.abnormalIv, R.id.abnormalTv})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.abnormalIv:
            case R.id.abnormalTv:
                if (mOnRegainClickListener != null) {
                    mOnRegainClickListener.onRegainData(view);
                }
                break;
        }
    }

    public void setOnRegainClickListener(OnRegainClickListener onRegainClickListener) {
        this.mOnRegainClickListener = onRegainClickListener;
    }
}
